<template>
  <div class="app">
    <div class="com-news">
      <img
        src="../../assets/img/newsinformation/logo8.jpg"
        alt="modification"
        style="width: 100%; height: 360px"
      />
    </div>
    <div class="tab-tit">
      <p><b>新闻中心</b></p>
      <span
        >您现在的位置 ->
        <a href="http://localhost:8080/NewsInformation">新闻中心</a>
        ->公司新闻
      </span>
    </div>
    <div v-for="item in this.postsList[0]" :key="item.id" >
      <h1 class="title">{{ item.titlezh }}</h1>
      <div class="time">本文创建时间：{{ item.time.substring(0, 10)}}</div>
      <div v-html="item.contentzh"></div>
    </div>
  </div>
</template>
<script>
import axios from "axios";
export default {
  data() {
    return {
      page: 1,
      tabPosition: "left",
      postsList: [],
      poot: [],
    };
  },
  created() {
    this.getPostData();
  },
  methods: {
    getPostData() {
      axios.get("api/api/new/" + this.$route.params.id).then((res) => {
        console.log(res.data);
        this.postsList = res.data;
        // console.log(this.postsList,1);
      });
    },
  },
};
</script>
<style >
.com-news{
  padding-top: 70px;
}
.tab-tit {
    overflow: hidden;
    border-bottom: #333 1px dotted;
    padding: 12px;
    margin-bottom: 30px;
  }
  .tab-tit p {
    font-size: 40px;
    float: left;
  }
  .tab-tit span {
    padding-top: 55px;
    font-size: 20px;
    float: right;
  }
  .tab-tit span a {
    color: #333;
    text-decoration: none;
  }
  #id{
    text-align:center;
  }
  a:hover{
    color: red;
  }
  @media screen  and (max-width: 1100px ) {
    .com-news img {
    width: 100%;
    height: 220px!important;
  }
  }
  
</style>